(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/scripts/GameNetMgr.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, '9545659TARKZLMoHGqXoY2N', 'GameNetMgr', __filename);
// scripts/GameNetMgr.js

"use strict";

var _timers = require("timers");

cc.Class({
    extends: cc.Component,

    properties: {
        dataEventHandler: null,
        roomId: null,
        maxNumOfGames: 0,
        numOfGames: 0,
        numOfMJ: 0,
        seatIndex: -1,
        seats: null,
        turn: -1,
        button: -1,
        chupai: -1,
        cards: null,
        gamestate: "",
        isOver: false,
        isCurOver: false,
        dissoveData: null,
        useful: null,
        wait: false,
        gameState: false,
        buttonid: null,
        connectnum: 0,
        resultslist: null
        // invitestate: 0,
    },

    mjreset: function mjreset() {
        this.turn = -1;
        this.chupai = -1;
        this.button = -1;
        this.gamestate = "";
        this.curaction = null;
        for (var i = 0; i < this.seats.length; ++i) {
            if (this.seats[i] != null) {
                this.seats[i].holds = [];
                this.seats[i].folds = [];
                this.seats[i].pengs = [];
                this.seats[i].chis = [];
                this.seats[i].angangs = [];
                this.seats[i].diangangs = [];
                this.seats[i].wangangs = [];
                this.seats[i].ready = false;
                this.seats[i].hued = false;
            }
        }
    },

    pkreset: function pkreset() {
        this.button = -1;
        this.gamestate = "";
        this.curaction = null;
        for (var i = 0; i < this.seats.length; ++i) {}
    },
    clear: function clear() {
        this.dataEventHandler = null;
        if (this.isOver == null) {
            this.seats = null;
            this.roomId = null;
            this.maxNumOfGames = 0;
            this.numOfGames = 0;
        }
    },

    dispatchEvent: function dispatchEvent(event, data) {
        var _this = this;
        if (_this.dataEventHandler) {
            _this.dataEventHandler.emit(event, data);
        } else {
            (0, _timers.setTimeout)(function () {
                if (_this.dataEventHandler) {
                    _this.dataEventHandler.emit(event, data);
                }
            }, 1000);
        }
    },


    getSeatIndexByID: function getSeatIndexByID(userId) {
        for (var i = 0; i < this.seats.length; ++i) {
            var s = this.seats[i];
            if (s.userid == userId && s != null) {
                return i;
            }
        }
        return -1;
    },

    isOwner: function isOwner() {
        return this.seatIndex == 0;
    },

    getSeatByID: function getSeatByID(userId) {
        var seatIndex = this.getSeatIndexByID(userId);
        var seat = this.seats[seatIndex];
        return seat;
    },

    getSelfData: function getSelfData() {
        return this.seats[this.seatIndex];
    },

    getLocalIndex: function getLocalIndex(index) {
        var num = 4;
        if (this.conf.type == "mj") {
            num = 4;
        } else {
            num = 10;
        }
        var ret = (index - this.seatIndex + num) % num;
        return ret;
    },

    prepareMJReplay: function prepareMJReplay(roomInfo, detailOfGame) {
        this.roomId = roomInfo.id;
        this.seats = roomInfo.seats;
        this.turn = detailOfGame.base_info.button;
        this.button = detailOfGame.base_info.button;
        this.useful = detailOfGame.base_info.useful;
        var baseInfo = detailOfGame.base_info;
        var results = detailOfGame.results;
        for (var i = 0; i < this.seats.length; ++i) {
            var s = this.seats[i];
            if (s != null) {
                s.seatindex = i;
                s.holds = baseInfo.game_seats[i];
                s.pengs = [];
                s.chis = [];
                s.angangs = [];
                s.diangangs = [];
                s.wangangs = [];
                s.folds = [];
                if (cc.vv.userMgr.userId == s.userid) {
                    this.seatIndex = i;
                }
                for (var j = 0; j < results.length; j++) {
                    if (results[j]) {
                        if (s.userid == results[j].userid) {
                            s.score = results[j].score;
                        }
                    }
                }
            }
        }
        this.conf = {
            type: baseInfo.type
        };
        if (this.conf.type == null) {
            this.conf.type == "mj";
        }
        this.dispatchEvent('game_useful', this.useful);
    },

    prepareNNReplay: function prepareNNReplay(roomInfo, detailOfGame) {
        this.roomId = roomInfo.id;
        this.seats = roomInfo.seats;
        var baseInfo = detailOfGame.base_info;
        var results = detailOfGame.results;
        this.cards = detailOfGame.action_records;
        for (var i = 0; i < this.seats.length; ++i) {
            var s = this.seats[i];
            s.seatindex = i;
            if (cc.vv.userMgr.userId == s.userid) {
                this.seatIndex = i;
            }

            for (var j = 0; j < results.length; j++) {
                if (results[j]) {
                    if (s.userid == results[j].userid) {
                        s.score = results[j].score;
                    }
                }
            }
        }
        this.conf = {
            type: baseInfo.type
        };
        if (this.conf.type == null) {
            this.conf.type == "nn";
        }
    },

    initHandlers: function initHandlers() {
        var self = this;
        cc.vv.net.addHandler("login_result", function (data) {
            console.log("login_result");
            if (data.errcode === 0) {
                var data = data.data;
                self.roomId = data.roomid;
                self.conf = data.conf;
                self.maxNumOfGames = data.conf.maxGames;
                self.numOfGames = data.numofgames;
                self.seats = data.seats;
                self.seatIndex = self.getSeatIndexByID(cc.vv.userMgr.userId);
                self.isOver = false;
                console.log(data.seats);
            } else {
                console.log(data.errmsg);
            }
        });

        cc.vv.net.addHandler("login_finished", function (data) {
            console.log("login_finished");
            self.conf = self.conf;
            if (self.conf.type == "mj") {
                cc.director.loadScene("mjgame");
            } else if (self.conf.type == "nn") {
                cc.director.loadScene("nngame");
            } else if (self.conf.type == "jdb") {
                cc.director.loadScene("jdbgame");
            }
        });

        cc.vv.net.addHandler("exit_result", function (data) {
            console.log("exit_result");
            self.roomId = null;
            self.turn = -1;
            self.seats = null;
        });

        cc.vv.net.addHandler("exit_notify_push", function (data) {
            console.log("exit_notify_push"); //玩家退出房间
            var userId = data;
            var s = self.getSeatByID(userId);
            if (s != null && s.userid != 0) {
                self.dispatchEvent("exit_notify", s);
                for (var i = 0; i < self.seats.length; ++i) {
                    if (self.seats[i].userid == s.userid) {
                        s.userid = 0;
                        s.name = "";
                        s.ip = "";
                        self.seats.push(self.seats[i]);
                        self.seats.splice(i, 1);
                    }
                    self.seats[i].seatindex = i;
                    if (self.seats[i].userid == cc.vv.userMgr.userId) {
                        self.seatIndex = i;
                    }
                }
                self.dispatchEvent("update_user_comes", s);
            }
        });

        cc.vv.net.addHandler("dispress_push", function (data) {
            console.log('dispress_push'); //房主解散房间
            self.roomId = null;
            self.turn = -1;
            self.seats = null;
        });

        cc.vv.net.addHandler("hall_dealings_push", function (data) {
            console.log(data);
        });

        cc.vv.net.addHandler("disconnect", function (data) {
            if (self.roomId == null) {
                cc.director.loadScene("hall");
            } else {
                if (self.isOver == false) {
                    cc.vv.userMgr.oldRoomId = self.roomId;
                    self.dispatchEvent("disconnect");
                } else {
                    self.roomId = null;
                }
            }
        });

        cc.vv.net.addHandler("new_user_comes_push", function (data) {
            console.log("new_user_comes_push");
            var seatIndex = data.seatindex;
            if (self.seats[seatIndex].userid > 0) {
                self.seats[seatIndex].online = true;
            } else {
                data.online = true;
                self.seats[seatIndex] = data;
            }
            self.dispatchEvent('new_user', self.seats[seatIndex]);
        });

        cc.vv.net.addHandler("remove_user_comes_push", function (data) {
            console.log("remove_user_comes_push");
            self.dispatchEvent('remove_user_comes');
        });

        cc.vv.net.addHandler("update_user_comes_push", function (data) {
            console.log("update_user_comes_push");
            var arr = [];
            for (var i = 0; i < data.seats.length; ++i) {
                var json = {};
                for (var r in data.seats[i]) {
                    json[r.toLocaleLowerCase()] = data.seats[i][r];
                }
                arr.push(json);
            }
            self.seats = arr;
            self.dispatchEvent('update_user_comes', data.buttonBool);
        });

        cc.vv.net.addHandler("user_state_push", function (data) {
            console.log("user_state_push");
            var userId = data.userid;
            var seat = self.getSeatByID(userId);
            seat.online = data.online;
            self.dispatchEvent('user_state_changed', seat);
        });

        cc.vv.net.addHandler("user_ready_push", function (data) {
            console.log("user_ready_push");
            self.mjreset();
            self.pkreset();
            self.button = data.button;
            var userId = data.userid;
            var seat = self.getSeatByID(userId);
            seat.ready = data.ready;
            for (var i = 0; i < self.seats.length; ++i) {
                self.seats[i].ready = data.seats[i].ready;
            }
            self.dispatchEvent('user_state_changed', data.seats);
        });

        cc.vv.net.addHandler("game_holds_push", function (data) {
            console.log("game_holds_push");
            var seat = self.seats[self.seatIndex];
            seat.holds = data;
            for (var i = 0; i < self.seats.length; ++i) {
                if (self.seats[i].userid != 0) {
                    var s = self.seats[i];
                    if (s.folds == null) {
                        s.folds = [];
                    }
                    if (s.pengs == null) {
                        s.pengs = [];
                    }
                    if (s.chis == null) {
                        s.chis = [];
                    }
                    if (s.angangs == null) {
                        s.angangs = [];
                    }
                    if (s.diangangs == null) {
                        s.diangangs = [];
                    }
                    if (s.wangangs == null) {
                        s.wangangs = [];
                    }
                    s.ready = false;
                }
            }
            self.dispatchEvent('game_holds', data);
        });

        cc.vv.net.addHandler("game_begin_push", function (data) {
            console.log('game_begin_push');
            if (self.conf.type == "mj") {
                self.button = data.button;
                self.turn = self.button;
                self.gamestate = "begin";
                for (var i = 0; i < data.seats.length; i++) {
                    if (data.seats[i].userid != 0) {
                        self.seats[i].ready = data.seats[i].ready;
                    }
                }
            }
            self.dispatchEvent('game_begin', data);
        });

        cc.vv.net.addHandler("game_useful_push", function (data) {
            console.log('game_useful_push');
            self.useful = data;
            self.dispatchEvent('game_useful', data);
        });

        cc.vv.net.addHandler("game_playing_push", function (data) {
            console.log('game_playing_push');
            self.gamestate = "playing";
            self.dispatchEvent('game_playing');
        });

        cc.vv.net.addHandler("game_sync_push", function (data) {
            console.log("game_sync_push");
            self.numOfMJ = data.numofmj;
            self.gamestate = data.state;
            self.gameState = data.gameState;
            var time = 0;
            if (self.conf.type == "mj") {
                self.turn = data.turn;
                self.button = data.button;
                self.chupai = data.chuPai;
                for (var i = 0; i < 4; ++i) {
                    var seat = self.seats[i];
                    if (seat.userid != 0 && data.seats[i]) {
                        var sd = data.seats[i];
                        seat.holds = sd.holds;
                        seat.folds = sd.folds;
                        seat.angangs = sd.angangs;
                        seat.diangangs = sd.diangangs;
                        seat.wangangs = sd.wangangs;
                        seat.pengs = sd.pengs;
                        seat.chis = sd.chis;
                    }
                }
            } else {
                self.button = data.button;
                for (var i = 0; i < 10; ++i) {
                    var seat = self.seats[i];
                    if (seat.userid != 0 && data.seats[i]) {
                        var sd = data.seats[i];
                        console.log(sd);
                        seat.sifanbet = sd.sifanbet;
                        seat.duimenbet = sd.duimenbet;
                        seat.erguobet = sd.erguobet;
                    }
                }
            }

            self.dispatchEvent('game_sync', data);
        });

        cc.vv.net.addHandler("game_bet_push", function (data) {
            console.log('game_bet_push');
            self.isCurOver = false;
            for (var i = 0; i < self.seats.length; i++) {
                if (self.seats[i].userid != 0) {
                    self.seats[i].ready = false;
                }
            }
            self.dispatchEvent('game_bet', data);
        });

        cc.vv.net.addHandler("game_start_push", function (data) {
            console.log('game_start_push');
            self.gameState = data.gameState;
            self.button = data.button;
            self.dispatchEvent('game_start', data);
        });

        cc.vv.net.addHandler("game_shuffle_push", function (data) {
            console.log('game_shuffle_push');
            self.dispatchEvent('game_shuffle', data);
        });

        cc.vv.net.addHandler("game_shangzhuang_push", function (data) {
            console.log('game_shangzhuang_push');
            for (var i = 0; i < self.seats.length; ++i) {
                if (self.seats[i].userid == data.userid) {
                    self.button = self.seats[i].seatindex;
                }
            }
            self.dispatchEvent('game_start', data);
        });

        cc.vv.net.addHandler("exit_room_push", function (data) {
            console.log('exit_room_push');
            self.dispatchEvent('exit_room', data);
        });

        cc.vv.net.addHandler("game_guozhuang_push", function (data) {
            console.log('game_guo_push');
            self.dispatchEvent('game_guozhuang', data);
        });

        cc.vv.net.addHandler("game_total_push", function (data) {
            console.log('game_total_push');
            self.dispatchEvent('game_total', data);
        });

        cc.vv.net.addHandler("game_zhishai_ready_push", function (data) {
            console.log('game_zhishai_ready_push');
            self.button = data.button;
            self.buttonid = data.userid;
            self.dispatchEvent('game_zhishai_ready', data.userid);
        });

        cc.vv.net.addHandler("game_zhishai_push", function (data) {
            console.log('game_zhishai_push');
            self.gameState = data.gameState;
            self.dispatchEvent('game_zhishai', data);
        });

        cc.vv.net.addHandler("game_defect_push", function (data) {
            console.log('game_defect_push');
            self.dispatchEvent('game_defect', data);
        });

        cc.vv.net.addHandler("game_wait_push", function (data) {
            console.log('game_wait_push');
            self.gameState = true;
            self.dispatchEvent('game_wait', data);
        });

        cc.vv.net.addHandler("hangang_notify_push", function (data) {
            self.dispatchEvent('hangang_notify', data);
        });

        cc.vv.net.addHandler("game_action_push", function (data) {
            console.log("game_action_push");
            self.curaction = data;
            self.dispatchEvent('game_action', data);
        });

        cc.vv.net.addHandler("game_chupai_push", function (data) {
            console.log('game_chupai_push');
            var turnUserID = data;
            var si = self.getSeatIndexByID(turnUserID);
            self.doTurnChange(si);
        });

        cc.vv.net.addHandler("game_num_push", function (data) {
            console.log("game_num_push");
            self.numOfGames = data;
            self.dispatchEvent('game_num', data);
        });

        cc.vv.net.addHandler("mj_count_push", function (data) {
            console.log('mj_count_push');
            self.numOfMJ = data;
            self.dispatchEvent('mj_count', data);
        });

        cc.vv.net.addHandler("game_over_push", function (data) {
            console.log('game_over_push');
            self.gameState = data.gameState;
            var results = data.results;
            for (var i = 0; i < self.seats.length; ++i) {
                if (self.seats[i].userid != 0 && self.seats[i].ready && results[i]) {
                    self.seats[i].score = results.length == 0 ? 0 : results[i].totalscore;
                    self.seats[i].ready = false;
                }
            }

            if (data.endinfo) {
                self.isOver = true;
                (0, _timers.setTimeout)(function () {
                    self.dispatchEvent('game_end', data.endinfo);
                }, 500);
            } else {
                self.isCurOver = true;
            }

            self.dispatchEvent('game_over', data);
            for (var i = 0; i < self.seats.length; ++i) {
                if (self.seats[i].userId != 0) {
                    self.dispatchEvent('user_state_changed', self.seats[i]);
                }
            }
        });

        cc.vv.net.addHandler("game_curover_push", function (data) {
            self.isCurOver = !self.isOver;
            self.dispatchEvent('game_curover');
        });

        cc.vv.net.addHandler("hu_push", function (data) {
            console.log('hu_push');
            self.doHu(data);
        });

        cc.vv.net.addHandler("game_chupai_notify_push", function (data) {
            console.log("game_chupai_notify_push");
            var userId = data.userId;
            var pai = data.pai;
            var si = self.getSeatIndexByID(userId);
            self.doChupai(si, pai);
        });

        cc.vv.net.addHandler("game_mopai_push", function (data) {
            console.log('game_mopai_push');
            self.doMopai(self.seatIndex, data);
        });

        cc.vv.net.addHandler("guo_notify_push", function (data) {
            console.log('guo_notify_push');
            var userId = data.userId;
            var pai = data.pai;
            var si = self.getSeatIndexByID(userId);
            self.doGuo(si, pai);
        });

        cc.vv.net.addHandler("guo_result", function (data) {
            console.log('guo_result');
            self.dispatchEvent('guo_result');
        });

        cc.vv.net.addHandler("guohu_push", function (data) {
            console.log('guohu_push');
            self.dispatchEvent("push_notice", { info: "过胡", time: 1.5 });
        });

        cc.vv.net.addHandler("peng_notify_push", function (data) {
            console.log('peng_notify_push');
            var userId = data.userid;
            var pai = data.pai;
            var si = self.getSeatIndexByID(userId);
            self.doPeng(si, data.pai);
        });

        cc.vv.net.addHandler("chi_notify_push", function (data) {
            console.log('chi_notify_push');
            var userId = data.userid;
            var si = self.getSeatIndexByID(userId);
            self.doChi(si, data.pai, data.chipai);
        });

        cc.vv.net.addHandler("gang_notify_push", function (data) {
            console.log('gang_notify_push');
            var userId = data.userid;
            var pai = data.pai;
            var si = self.getSeatIndexByID(userId);
            self.doGang(si, pai, data.gangtype);
        });

        cc.vv.net.addHandler("chat_push", function (data) {
            console.log("chat_push");
            self.dispatchEvent("chat_push", data);
        });

        cc.vv.net.addHandler("quick_chat_push", function (data) {
            console.log("quick_chat_push");
            self.dispatchEvent("quick_chat_push", data);
        });

        cc.vv.net.addHandler("emoji_push", function (data) {
            console.log("emoji_push");
            self.dispatchEvent("emoji_push", data);
        });

        cc.vv.net.addHandler("dissolve_notice_push", function (data) {
            console.log("dissolve_notice_push");
            self.dissoveData = data;
            self.dispatchEvent("dissolve_notice", data);
        });

        cc.vv.net.addHandler("dissolve_cancel_push", function (data) {
            console.log("dissolve_cancel_push");
            self.dissoveData = null;
            self.dispatchEvent("dissolve_cancel", data);
        });

        cc.vv.net.addHandler("voice_msg_push", function (data) {
            console.log("voice_msg_push");
            self.dispatchEvent("voice_msg", data);
        });

        cc.vv.net.addHandler("user_message", function (data) {
            console.log('user_message');
        });

        cc.vv.net.addHandler("hall_message_connect_successfu", function (data) {
            console.log('hall_message_connect_successfu');
            self.dispatchEvent("hall_message", data);
        });

        cc.vv.net.addHandler("give_message", function (data) {
            console.log('give_message');
            if (data) {
                cc.vv.alert.show("收到ID为" + data.otheruserid + "好友，赠送你的" + data.gems + "个房豆！");
            }
        });

        cc.vv.net.addHandler("send_msgToUser_Info", function (data) {
            console.log('send_msgToUser_Info');
        });
    },

    doGuo: function doGuo(seatIndex, pai) {
        var seatData = this.seats[seatIndex];
        var folds = seatData.folds;
        folds.push(pai);
        this.dispatchEvent('guo_notify', seatData);
    },

    doMopai: function doMopai(seatIndex, pai) {
        var seatData = this.seats[seatIndex];
        if (seatData.holds) {
            seatData.holds.push(pai);
            this.dispatchEvent('game_mopai', { seatIndex: seatIndex, pai: pai });
        }
    },

    doChupai: function doChupai(seatIndex, pai) {
        this.chupai = pai;
        var seatData = this.seats[seatIndex];
        if (seatData.holds) {
            var idx = seatData.holds.indexOf(pai);
            seatData.holds.splice(idx, 1);
        }
        this.dispatchEvent('game_chupai_notify', { seatData: seatData, pai: pai });
    },

    doPeng: function doPeng(seatIndex, pai) {
        var seatData = this.seats[seatIndex];
        //移除手牌
        if (seatData.holds) {
            for (var i = 0; i < 2; ++i) {
                var idx = seatData.holds.indexOf(pai);
                seatData.holds.splice(idx, 1);
            }
        }

        //更新碰牌数据
        var pengs = seatData.pengs;
        pengs.push(pai);

        this.dispatchEvent('peng_notify', seatData);
    },

    doChi: function doChi(seatIndex, pai, chipai) {
        var seatData = this.seats[seatIndex];
        //移除手牌
        if (seatData.holds) {
            for (var i = 0; i < 3; ++i) {
                if (chipai[i] != pai) {
                    var idx = seatData.holds.indexOf(chipai[i]);
                    seatData.holds.splice(idx, 1);
                }
            }
        }
        //更新吃牌数据
        var chis = seatData.chis;
        chis.push(chipai);
        this.dispatchEvent('chi_notify', seatData);
    },

    getGangType: function getGangType(seatData, pai) {
        if (seatData.pengs.indexOf(pai) != -1) {
            return "wangang";
        } else {
            var cnt = 0;
            for (var i = 0; i < seatData.holds.length; ++i) {
                if (seatData.holds[i] == pai) {
                    cnt++;
                }
            }
            if (cnt == 3) {
                return "diangang";
            } else {
                return "angang";
            }
        }
    },

    doGang: function doGang(seatIndex, pai, gangtype) {
        var seatData = this.seats[seatIndex];
        if (!gangtype) {
            gangtype = this.getGangType(seatData, pai);
        }

        if (gangtype == "wangang") {
            if (seatData.pengs.indexOf(pai) != -1) {
                var idx = seatData.pengs.indexOf(pai);
                if (idx != -1) {
                    seatData.pengs.splice(idx, 1);
                }
            }
            seatData.wangangs.push(pai);
        }
        if (seatData.holds) {
            for (var i = 0; i <= 4; ++i) {
                var idx = seatData.holds.indexOf(pai);
                if (idx == -1) {
                    //如果没有找到，表示移完了，直接跳出循环
                    break;
                }
                seatData.holds.splice(idx, 1);
            }
        }
        if (gangtype == "angang") {
            seatData.angangs.push(pai);
        } else if (gangtype == "diangang") {
            seatData.diangangs.push(pai);
        }
        this.dispatchEvent('gang_notify', { seatData: seatData, gangtype: gangtype });
    },

    doHu: function doHu(data) {
        this.dispatchEvent('hupai', data);
    },

    doTurnChange: function doTurnChange(si) {
        var data = {
            last: this.turn,
            turn: si
        };
        this.turn = si;
        this.dispatchEvent('game_chupai', data);
    },

    sendmsg: function sendmsg(data) {
        console.log('send_msg');
        cc.vv.net.send('send_msg', data);
    },

    connectGameServer: function connectGameServer(data, scene) {
        cc.vv.net.ip = data.ip + ":" + data.port;
        cc.vv.gameNetMgr.connectnum = 0;
        this.dissoveData = null;
        var self = this;
        var onConnectOK = function onConnectOK() {
            var sd = {
                token: data.token,
                roomid: data.roomid,
                time: data.time,
                sign: data.sign,
                userid: cc.vv.userMgr.userId
            };
            cc.vv.net.send("login", sd);
        };

        var onConnectFailed = function onConnectFailed() {
            console.log("failed.");
            cc.vv.wc.hide();
        };
        cc.vv.wc.show("正在进入房间");
        cc.vv.net.connect(onConnectOK, onConnectFailed, scene);
    },

    connectHallServer: function connectHallServer(data, eventvalue, scene) {
        this.dissoveData = null;
        cc.vv.net.ip = data.serverip + ":" + data.port;
        cc.vv.gameNetMgr.connectnum++;
        var self = this;

        var onConnectOK = function onConnectOK() {
            var sd = {
                userid: cc.vv.userMgr.userId
            };
            cc.vv.net.send(eventvalue, sd);
        };

        var onConnectFailed = function onConnectFailed() {
            console.log("failed.");
            cc.vv.wc.hide();
        };
        cc.vv.wc.show("正在进入大厅");
        cc.vv.net.connect(onConnectOK, onConnectFailed, scene);
    }
});

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=GameNetMgr.js.map
        